<style>
    .item_box img{
        width: 100%;
        height: 100%;
    }
</style>
<script type="text/html" id="time-form-html">
    {php include $this->template('_time_item');}
</script>
<div class="main">

    <script>
        require(['jquery', 'util'], function($, u){
            $('.account p a').each(function(){
                u.clip(this, $(this).text());
            });
        });
    </script>
    <form action="" method="post" onsubmit="return check();" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default">
            <div class="panel-heading">
                门店信息
            </div>
            <div class="panel-body">
                <ul class="nav nav-tabs" id="myTab">
                    <li class="active"><a href="#tab_basic" aria-controls="tab_basic" role="tab" data-toggle="pill">基本信息</a></li>
                    <li><a href="#tab_high" aria-controls="tab_high" role="tab" data-toggle="pill">高级设置</a></li>
                    <li><a href="#tab_out" aria-controls="tab_out" role="tab" data-toggle="pill">外送设置</a></li>
                    <li><a href="#tab_paytype" aria-controls="tab_paytype" role="tab" data-toggle="pill">支付设置</a></li>
                    <li><a href="#tab_nave_text" aria-controls="tab_nave_text" role="tab" data-toggle="pill">个性化信息</a></li>
                    <li><a href="#tab_link" aria-controls="tab_link" role="tab" data-toggle="pill">外链设置</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane  active" id="tab_basic">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="title" value="{$reply['title']}" id="title" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店默认跳转</label>
                            <div class="col-sm-9 col-xs-9 col-md-9">
                                <label class="radio-inline"><input type="radio" name="default_jump" value="1" {if $reply['default_jump']==1}checked{/if}> 门店详情页</label>
                                <label class="radio-inline"><input type="radio" name="default_jump" value="2" {if $reply['default_jump']==2}checked{/if}> 外卖
                                </label>
                                <label class="radio-inline"><input type="radio" name="default_jump" value="3" {if $reply['default_jump']==3}checked{/if}> 快餐
                                </label>
                                <label class="radio-inline"><input type="radio" name="default_jump" value="4" {if $reply['default_jump']==4}checked{/if}> 排队
                                </label>
                                <label class="radio-inline"><input type="radio" name="default_jump" value="5" {if $reply['default_jump']==5}checked{/if}> 预定
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="color:#f00;">门店状态</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_show" value="1" {if
                                           $reply['is_show']==1||empty($reply)}checked{/if}>开启
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_show" value="0" {if isset($reply['is_show']) &&empty($reply['is_show'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店Logo</label>
                            <div class="col-sm-9">
                                {php echo tpl_form_field_image('logo', $reply['logo'])}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店公告</label>
                            <div class="col-sm-9">
                                <input type="text" name="announce" value="{$reply['announce']}" id="announce" class="form-control" />
                                <div class="help-block">在门店详细页显示</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">预定公告</label>
                            <div class="col-sm-9">
                                <input type="text" name="reservation_announce" value="{$reply['reservation_announce']}" id="reservation_announce" class="form-control" />
                                <div class="help-block">在预定页显示</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店简介</label>
                            <div class="col-sm-9">
                                <input type="text" name="info" value="{$reply['info']}" id="info" class="form-control" />
                                <div class="help-block">在门店列表显示</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店类型</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="type" id="type">
                                    <option value="0">请选择</option>
                                    {loop $shoptype $item}
                                    <option value="{$item['id']}" {if $reply['typeid']==$item['id']}selected{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                                <div class="help-block">
                                    还没有分类，点我 <a href="{php echo $this->createWebUrl('type', array('op' => 'post'))}"><i class="fa fa-plus-circle"></i> 添加分类</a>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">所属区域</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="area" id="area">
                                    <option value="0">请选择</option>
                                    {loop $area $item}
                                    <option value="{$item['id']}" {if $reply['areaid']==$item['id']}selected{/if}>{$item['name']}</option>
                                    {/loop}
                                </select>
                                <div class="help-block">
                                    还没有区域，点我 <a href="{php echo $this->createWebUrl('area', array('op' => 'post'))}"><i class="fa fa-plus-circle"></i> 添加区域</a>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店级别</label>
                            <div class="col-sm-9">
                                <select name="level" id="level" class="form-control">
                                    <option value="1"{if $reply['level']==1} selected{/if}>★</option>
                                    <option value="2"{if $reply['level']==2} selected{/if}>★★</option>
                                    <option value="3"{if empty($reply) || $reply['level']==3} selected{/if}>★★★</option>
                                    <option value="4"{if $reply['level']==4} selected{/if}>★★★★</option>
                                    <option value="5"{if $reply['level']==5} selected{/if}>★★★★★</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">人均消费</label>
                            <div class="col-sm-9">
                                <input type="text" name="consume" class="form-control" value="{if empty($reply)}20.0{else}{$reply['consume']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">营业时间</label>
                            <div class="col-sm-3">
                                <div class="input-group clockpicker">
                                    <input type="text" class="form-control" value="{$reply['begintime']}" name="begintime">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group clockpicker">
                                    <input type="text" class="form-control" value="{$reply['endtime']}" name="endtime">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店介绍</label>
                            <div class="col-sm-9">
                                <textarea style="height:200px; width:535px;" class="form-control richtext" name="content" cols="70" id="reply-add-text">{$reply['content']}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">电话</label>
                            <div class="col-sm-9">
                                <input type="text" name="tel" id="tel" value="{$reply['tel']}" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">地址</label>
                            <div class="col-sm-9">
                                <input type="text" name="address" id="address" value="{$reply['address']}" class="form-control" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">商家QQ</label>
                            <div class="col-sm-9">
                                <input type="text" name="qq" class="form-control" value="{$reply['qq']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">商家微信</label>
                            <div class="col-sm-9">
                                <input type="text" name="weixin" class="form-control" value="{$reply['weixin']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">客服二维码</label>
                            <div class="col-sm-9">
                                {php echo tpl_form_field_image('kefu_qrcode', $reply['kefu_qrcode'])}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">坐标</label>
                            <div class="col-sm-9">
                                {php echo tpl_form_field_coordinate('baidumap', $reply)}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
                            <div class="col-sm-9">
                                <input type="text" name="displayorder" value="{$reply['displayorder']}" id="displayorder" class="form-control" />
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_high">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启语音提示</label>
                            <div class="col-sm-9">
                                <label for="is_speaker1" class="radio-inline"><input type="radio" name="is_speaker" value="1" id="is_speaker1" {if $reply['is_speaker']==1}checked{/if} /> 开启</label>
                                <label for="is_speaker2" class="radio-inline"><input type="radio" name="is_speaker" value="0" id="is_speaker2"  {if $reply['is_speaker']==0 || empty($reply)}checked{/if} /> 关闭</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持预定</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_reservation" value="1" {if $reply['is_reservation']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_reservation" value="0" {if isset($reply['is_reservation']) && empty($reply['is_reservation'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持店内</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_meal" value="1" {if $reply['is_meal']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_meal" value="0" {if isset($reply['is_meal']) && empty($reply['is_meal'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持外卖</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_delivery" value="1" {if $reply['is_delivery']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_delivery" value="0" {if isset($reply['is_delivery']) && empty($reply['is_delivery'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持快餐</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_snack" value="1" {if $reply['is_snack']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_snack" value="0" {if isset($reply['is_snack']) && empty($reply['is_snack'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持排队</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_queue" value="1" {if $reply['is_queue']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_queue" value="0" {if isset($reply['is_queue']) && empty($reply['is_queue'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持智能推荐套餐</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_intelligent" value="1" {if $reply['is_intelligent']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_intelligent" value="0" {if isset($reply['is_intelligent']) && empty($reply['is_intelligent'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持寄存</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_savewine" value="1" {if $reply['is_savewine']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_savewine" value="0" {if isset($reply['is_savewine']) && empty($reply['is_savewine'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持呼叫服务员通知<code>店内</code></label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_operator1" value="1" {if $reply['is_operator1']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_operator1" value="0" {if isset($reply['is_operator1']) && empty($reply['is_operator1'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">支持打包通知<code>店内</code></label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_operator2" value="1" {if $reply['is_operator2']==1 || empty($reply)}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_operator2" value="0" {if isset($reply['is_operator2']) && empty($reply['is_operator2'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知时间间隔</label>
                            <div class="col-sm-9">
                                <input type="text" name="notice_space_time" class="form-control"
                                       value="{$reply['notice_space_time']}" style="width: 120px;"/>
                                <div class="help-block">单位：秒</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否推荐</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_hot" value="1" {if $reply['is_hot']==1 || empty($reply)}checked{/if}>是
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_hot" value="0" {if isset($reply['is_hot']) && empty($reply['is_hot'])}checked{/if}>否
                                </label>
                                <div class="help-block">
                                    在搜索页显示
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">首次下单短信验证</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="is_sms" value="1" {if $reply['is_sms']==1}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="is_sms" value="0" {if empty($reply['is_sms'])}checked{/if}>关闭
                                </label>
                                {if !empty($reply)}
                                <div class="help-block" style="color:#f00;">注意:如果没有配置短信，请不要开启</div>
                                {/if}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">提供服务</label>
                            <div class="col-sm-9">
                                <label class="checkbox-inline">
                                    <input type="checkbox" id="enable_wifi" name="enable_wifi" value=1 {if $reply['enable_wifi']==1}checked{/if}/>wifi
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" id="enable_card" name="enable_card" value=1 {if $reply['enable_card']==1}checked{/if}/>刷卡
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" id="enable_room" name="enable_room" value=1 {if $reply['enable_room']==1}checked{/if}/>包厢
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" id="enable_park" name="enable_park" value=1 {if $reply['enable_park']==1}checked{/if}/>停车
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_paytype">
                        {if $setting['wechat']==1}
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">微信支付</label>
                                <div class="col-sm-9">
                                    <label for="wechat1" class="radio-inline"><input type="radio" name="wechat" id="wechat1" value="1" {if $reply['wechat'] == 1}checked="true"{/if} /> 开启</label>
                                    <label for="wechat2" class="radio-inline"><input type="radio" name="wechat" value="0" id="wechat2"  {if empty($reply) || $reply['wechat'] == 0}checked="true"{/if} /> 关闭</label>
                                    <span class="help-block"></span>
                                </div>
                            </div>
                        </div>
                        {/if}
                        {if $setting['alipay']==1}
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付宝</label>
                                <div class="col-sm-9">
                                    <label for="alipay1" class="radio-inline"><input type="radio" name="alipay" id="alipay1" value="1" {if $reply['alipay'] == 1}checked="true"{/if} /> 开启</label>
                                    <label for="alipay2" class="radio-inline"><input type="radio" name="alipay" value="0" id="alipay2"  {if empty($reply) || $reply['alipay'] == 0}checked="true"{/if} /> 关闭</label>
                                    <span class="help-block"></span>
                                </div>
                            </div>
                        </div>
                        {/if}
                        {if $setting['credit']==1}
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">余额支付</label>
                                <div class="col-sm-9">
                                    <label for="credit1" class="radio-inline"><input type="radio" name="credit" id="credit1" value="1" {if $reply['credit'] == 1}checked="true"{/if} /> 开启</label>
                                    <label for="credit2" class="radio-inline"><input type="radio" name="credit" value="0" id="credit2"  {if empty($reply) || $reply['credit'] == 0}checked="true"{/if} /> 关闭</label>
                                    <span class="help-block"></span>
                                </div>
                            </div>
                        </div>
                        {/if}
                        {if $setting['delivery']==1}
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">货到付款</label>
                                <div class="col-sm-9">
                                    <label for="delivery1" class="radio-inline"><input type="radio" name="delivery" id="delivery1" value="1" {if $reply['delivery'] == 1}checked="true"{/if} /> 开启</label>
                                    <label for="delivery2" class="radio-inline"><input type="radio" name="delivery" value="0" id="delivery2"  {if empty($reply) || $reply['delivery'] == 0}checked="true"{/if} /> 关闭</label>
                                    <span class="help-block"></span>
                                </div>
                            </div>
                        </div>
                        {/if}
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否支持子商户</label>
                                <div class="col-sm-9">
                                    <label for="is_business1" class="radio-inline"><input type="radio" name="is_business" id="is_business1" value="1" {if $reply['is_business'] == 1}checked="true"{/if} /> 开启</label>
                                    <label for="is_business2" class="radio-inline"><input type="radio" name="is_business" value="0" id="is_business2"  {if empty($reply) || $reply['is_business'] == 0}checked="true"{/if} /> 关闭</label>
                                    <span class="help-block">需要装收银功能开启才有效果</span>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">子商户链接ID</label>
                                <div class="col-sm-9">
                                    <input type="text" name="business_id" class="form-control" value="{$reply['business_id']}" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_nave_text">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">预定文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_reservation" class="form-control" value="{if empty($reply['btn_reservation'])}预定{else}{$reply['btn_reservation']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">店内文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_eat" class="form-control" value="{if empty($reply['btn_eat'])}店内{else}{$reply['btn_eat']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">外卖文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_delivery" class="form-control" value="{if empty($reply['btn_delivery'])}外卖{else}{$reply['btn_delivery']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">快餐文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_snack" class="form-control" value="{if empty($reply['btn_snack'])}快餐{else}{$reply['btn_snack']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">排队文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_queue" class="form-control" value="{if empty($reply['btn_queue'])}排队{else}{$reply['btn_queue']}{/if}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">寄存文本</label>
                            <div class="col-sm-9">
                                <input type="text" name="btn_intelligent" class="form-control" value="{if empty($reply['btn_intelligent'])}存酒{else}{$reply['btn_intelligent']}{/if}" />
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_link">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠名称1</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_title1" class="form-control" value="{$reply['coupon_title1']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠链接1</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_link1" class="form-control" value="{$reply['coupon_link1']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠名称2</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_title2" class="form-control" value="{$reply['coupon_title2']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠链接2</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_link2" class="form-control" value="{$reply['coupon_link2']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠名称3</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_title3" class="form-control" value="{$reply['coupon_title3']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">优惠链接3</label>
                            <div class="col-sm-9">
                                <input type="text" name="coupon_link3" class="form-control" value="{$reply['coupon_link3']}" />
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="tab_out">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">消费满多少元免配送费</label>
                            <div class="col-sm-9">
                                <input type="text" name="freeprice" class="form-control" value="{$reply['freeprice']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">外卖配送费用</label>
                            <div class="col-sm-9">
                                <input type="text" name="dispatchprice" class="form-control" value="{$reply['dispatchprice']}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">外卖起送价格</label>
                            <div class="col-sm-9">
                                <input type="text" name="sendingprice" class="form-control" value="{$reply['sendingprice']}" />
                                <div class="help-block">低于该金额用户无法下单，商家拒绝配送</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">不允许选择当日配送时间</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" name="delivery_isnot_today" value="1" {if $reply['delivery_isnot_today']==1}checked{/if}>启用
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="delivery_isnot_today" value="0" {if empty($reply['delivery_isnot_today'])}checked{/if}>关闭
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">允许提前几天点外卖</label>
                            <div class="col-sm-9">
                                <input type="text" name="delivery_within_days" class="form-control" value="{$reply['delivery_within_days']}" />
                                <div class="help-block">单位：天，如果只接受当天订单，请填写0</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">配送半径</label>
                            <div class="col-sm-9">
                                <input type="text" name="delivery_radius" class="form-control" value="{$reply['delivery_radius']}" />
                                <div class="help-block">单位：公里</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                            <div class="col-sm-9">
                                <label for="not_in_delivery_radius" class="checkbox-inline">
                                    <input type="checkbox" name="not_in_delivery_radius" value="1" id="not_in_delivery_radius" {if $reply['not_in_delivery_radius'] == 1}checked="true"{/if} /> 在配送半径之外是否允许下单
                                </label>
                                <div class="help-block">距离大于配送半径时是否允许下单，注意：手机定位精确性受天气、用户终端设备是否开启GPS以及硬件配置等影响很大，若此项设置为不允许下单，可能会导致部分用户无法成功下单</div>
                            </div>
                        </div>
                        <div id="time-list">
                            {php $flag = true;}
                            {if !empty($timelist)}
                            {loop $timelist $row}
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">{if $flag==true}配送时间{/if}</label>
                                <div class="col-sm-3">
                                    <div class="input-group clockpicker">
                                        <input type="text" class="form-control" value="{$row['begintime']}" name="begintimes[{$row['id']}]">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-time"></span>
                                        </span>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group clockpicker">
                                        <input type="text" class="form-control" value="{$row['endtime']}" name="endtimes[{$row['id']}]">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-time"></span>
                                        </span>
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    {if $flag==true}<a href="javascript:;" id="add-time"><i class="fa fa-plus-sign-alt"></i> 添加时间</a>{else}<a class="btn btn-default btn-sm" onclick="$(this).parents('.form-group').remove(); return false;" href="#"><i class="fa fa-times"></i></a>{/if}
                                </div>
                            </div>
                            {php $flag = false;}
                            {/loop}
                            {else}
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">配送时间</label>
                                <div class="col-sm-3">
                                    <div class="input-group clockpicker">
                                        <input type="text" class="form-control" value="08:30" name="newbegintime[]">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group clockpicker">
                                        <input type="text" class="form-control" value="18:00" name="newendtime[]">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                                    </div>
                                </div>
                                <div class="col-sm-2">
                                    <a href="javascript:;" id="add-time"><i class="fa fa-plus-sign-alt"></i> 添加时间</a>
                                </div>
                            </div>
                            {/if}
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                            <div class="col-sm-9">
                                <div class="help-block">请尽量以半小时为单位,方便顾客选择</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-12">
            <input type="submit" name="submit" value="保存设置" class="btn btn-primary col-lg-1" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>

<script type="text/javascript">
    require(['util', 'clockpicker'], function(u, $){
        $('.clockpicker :text').clockpicker({autoclose: true});

        u.editor($('.richtext')[0]);

        $('#add-time').click(function(){
            $('#time-list').append($('#time-form-html').html());
            $('.clockpicker :text').clockpicker({autoclose: true});
        });

//        $(document).on('click', '.remind-reply-del, .comment-reply-del, .times-del, .custom-url-del', function(){
//            $(this).parent().parent().remove();
//            return false;
//        });
    });
</script>
<script type="text/javascript">
    function check() {
        if($.trim($('#title').val()) == '') {
            message('没有输入门店名称.', '', 'error');
            return false;
        }
        return true;
    }
</script>